﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QualityRpt.Dao;
using System.Data;

namespace QualityRpt.Service
{
    public class DeviceService:BaseService
    {
        /// <summary>
        /// 默认电子标签设备ID
        /// </summary>
        public const int OBU_DEV = 1;
        /// <summary>
        /// 默认卡设备ID
        /// </summary>
        public const int ICARD_DEV = 2;
        /// <summary>
        /// 默认天线设备ID
        /// </summary>
        public const int AIRWIRE_DEV = 3;
       
        private static IDeviceDao _impDao = null;
        static DeviceService()
        {
            _impDao = CreateDaoInstance("IDeviceDao") as IDeviceDao;
        }
        public static DataTable GetSchema()
        {
            DataTable rtTable = _impDao.GetList("ID=0");
            return rtTable.Clone();
        }
        public static DataRow Save(DataRow row)
        {
            return _impDao.Save(row);
        }
        public static DataRow Update(DataRow row)
        {
            return _impDao.Update(row);
        }
        public static DataRow Get(long id)
        {
            return _impDao.Get(id);
        }
        public static void Delete(long id)
        {
            _impDao.Delete(id);
        }
        public static DataTable GetList(string where)
        {
            return _impDao.GetList(where);
        }
        public DataTable GetList(string where, string sort)
        {
            return _impDao.GetList(where, sort);
        }
    }
}
